翻訳と辞書
Words near each other
・ Literacy Florida!
・ Literacy for Life Foundation
・ Literacy in American Lives
・ Literacy In Bihar
・ Literacy in India
・ Literacy in Media Award
・ Literacy in Romania
・ Literacy in the United States
・ Literacy in Tokelau
・ Literacy Is Empowering Project
・ Literacy test
・ Literacy Training Service
・ Literacy Volunteers of Illinois
・ Literae Humaniores
・ Literal
Literal (computer programming)
・ Literal (magazine)
・ Literal (mathematical logic)
・ Literal and figurative language
・ Literal contracts in Roman law
・ Literal Latte
・ Literal movement grammar
・ Literal music video
・ Literal pool
・ Literal translation
・ Literalism
・ Literariness
・ Literarische Donaugesellschaft
・ Literary activism
・ Literary adaptation


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Literal (computer programming) : ウィキペディア英語版
Literal (computer programming)

In computer science, a literal is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values such as integers, floating-point numbers, and strings, and usually for booleans and characters; some also have notations for elements of enumerated types and compound values such as arrays, records, and objects. An anonymous function is a literal for the function type.
In contrast to literals, variables or constants are symbols that can take on one of a class of fixed values, the constant being constrained not to change. Literals are often used to initialize variables, for example, in the following, 1 is an integer literal and the three letter string in "cat" is a string literal:

int a = 1;
String s = "cat";

In lexical analysis, literals of a given type are generally a token type, with a grammar rule, like "a string of digits" for an integer literal. Some literals are specific keywords, like true for the boolean literal "true".
In some object-oriented languages (like ECMAScript), objects can also be represented by literals. Methods of this object can be specified in the object literal using function literals. The brace notation below, which is also used for array literals, is typical for object literals:




==Literals of objects==
In ECMAScript (as well as its derivatives JavaScript and ActionScript), an object with methods can be written using the object literal like this:

var newobj =
};
newobj.method1();
newobj.method2();

These object literals are similar to anonymous classes in other languages like Java. The difference being that ECMAScript doesn't have classes because it's a prototype-based language.
The JSON data interchange format is based on a subset of the JavaScript object literal syntax, with some additional restrictions (among them requiring all keys to be quoted, and disallowing functions and everything else except data literals). Because of this, ''almost'' every valid JSON document (except for some subtleties with escaping) is also valid JavaScript code, a fact exploited in the JSONP technique.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Literal (computer programming)」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.